{% extends 'index.html' %}
{% block title %}
{% endblock %}

{% block head %}
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/animate.min.css">
    <link rel="stylesheet/less" href="/static/css/reset.less">
    <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
    <link rel="stylesheet/less" href="/static/css/index.less">
    <link rel="stylesheet/less" href="/static/css/common.less">
{% endblock %}

{% block main %}

    <div class="inner_body">
        <form action="/add_product" id="product_form" method="post" enctype="multipart/form-data">
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品类别</span>
                <div class="dropdown menu_cate">
                    <button class="btn btn-default dropdown-toggle" type="button"
                            id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"
                            aria-expanded="true">
                        <span class="one_cate">一级类别</span>
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                        {% for category in categorys %}
                            <li id="{{ category.id }}" class="one_li"><a
                                    href="#">{{ category.cname }}</a></li>
                        {% endfor %}
                    </ul>
                </div>

            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品名称</span>
                <input type="text" maxlength="50" id="pname"
                       class="form-control must_input_product" name="pname"
                       placeholder="商品名称" aria-describedby="basic-addon1">
            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品描述</span>
                <textarea class="form-control must_input_product" id="pDesc" name="pDesc"
                          rows="3" placeholder="说说你的商品吧~"></textarea>
            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品数量</span>
                <input type="number" max="100" maxlength="2" id="counts"
                       onkeyup="this.value=this.value.replace(/\D/g,'')"
                       onafterpaste="this.value=this.value.replace(/\D/g,'')"
                       class="form-control must_input_product" name="counts"
                       placeholder="商品数量" aria-describedby="basic-addon1">
            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品原价</span>
                <input type="number" maxlength="8" id="old_price"
                       onkeyup="value=value.replace(/[^\d.]/g,'')"
                       class="form-control must_input_product" name="old_price"
                       placeholder="商品原价" aria-describedby="basic-addon1">
            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品售价</span>
                <input type="number" maxlength="8"
                       onkeyup="value=value.replace(/[^\d.]/g,'')" id="new_price"
                       class="form-control must_input_product" name="new_price"
                       placeholder="你出价" aria-describedby="basic-addon1">
            </div>
            <div class="input-group">
                <span class="input-group-addon" id="basic-addon1">商品照片</span>
                <div class="htmleaf-container">
                    <div class="container">

                        <div class="row">
                            <div class="col-md-12">

                                <input type="file" name="file" multiple id="ssi-upload"/>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            {#<button type="submit" class="btn btn-success fb" style="width: 100%;"
                    onclick="checkAll()">发布商品
            </button>
            #}
             <input type="submit" class="btn btn-success fb" style="width: 100%;" value="发布商品">
        </form>
    </div>

{% endblock %}

<script src="/static/js/jquery-3.7.1.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/wow.min.repeat.js"></script>
<script src="/static/js/swiper-bundle.min.js"></script>
<script src="/static/js/less.js"></script>
<script>
    var mySwiper = new Swiper('.swiper', {
        loop: true, // 循环模式选项

        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },

        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        }

    })

</script>

